---
title: Custom-duration timeline views
layout: demo-v4
plugins: [ interaction, timeline, resource-common, resource-timeline ]
---
<script>

  document.addEventListener('DOMContentLoaded', function() {
    var calendarEl = document.getElementById('calendar');

    var calendar = new FullCalendar.Calendar(calendarEl, {
      plugins: [ 'interaction', 'resourceTimeline' ],
      timeZone: 'UTC',
      header: {
        left: 'today prev,next',
        center: 'title',
        right: 'resourceTimelineDay,resourceTimelineTenDay,resourceTimelineMonth,resourceTimelineYear'
      },
      defaultView: 'resourceTimelineDay',
      scrollTime: '08:00',
      aspectRatio: 1.5,
      views: {
        resourceTimelineDay: {
          buttonText: ':15 slots',
          slotDuration: '00:15'
        },
        resourceTimelineTenDay: {
          type: 'resourceTimeline',
          duration: { days: 10 },
          buttonText: '10 days'
        }
      },
      editable: true,
      resourceLabelText: 'Rooms',
      resources: '{{ site.data.demo_feed_baseurl }}/demo-resources.json?with-nesting&with-colors',
      events: '{{ site.data.demo_feed_baseurl }}/demo-events.json?single-day&for-resource-timeline'
    });

    calendar.render();
  });

</script>
